<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <span>{{num}}</span>
        <span>+3</span>
        <button @click='handle'>增加</button>
        <button @click='handle1'>减少</button>
        <button @click='handle2(1,2,$event)'>按钮</button>
        <!-- 事件对象传递：将函数名称改成函数调用，调用函数，也传参数，事件对象$evnet放在最后面 -->
    </div>
    <script src="../vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                num: 0
            },
            methods: {
                handle() {
                    this.num += 1
                },
                handle1() {
                    this.num -= 1
                },
                handle2(p, p1, e) {
                    console.log(p, p1);
                    console.log(e);
                }
            }
        })
    </script>
</body>

</html>